var Mock = require('mockjs')
var dept = require('./dept')


var employee = Mock.mock({
    "list|100":[{
        "emp_id|+1":1,
         "emp_name":"@cname",
         "emp_dept|1":dept.list,
         "emp_status|1":['in','out']
    }]
})

function getList(query){

     console.log("tes".match(''));

    console.log(query);

    return employee.list
    .filter(item=>
        item.emp_status=='in'
        &&
        item.emp_name.match(query.emp_name)!=null
    )
     .slice(query.start,query.end)
}

module.exports ={
    list:getList
}